Fix VMM handle leaks in virtual memory paths#2235
Open
fallintoplace wants to merge 2 commits into
Open
Conversation
Contributor
d4b0208 to
23647d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This patch fixes the VMM handle lifecycle by moving
cuMemRelease()calls inside the transaction boundary so release failures can still trigger rollback cleanup.Changes
allocate(), create a rollback-aware release closure and performcuMemRelease(handle)beforetrans.commit(); callback is conditional to avoid double release._grow_allocation_fast_path(), releasenew_handlebeforetrans.commit()and guard rollback callback to only release if not already released._grow_allocation_slow_path(), keepold_handlepinned until remap-dependent rollback logic is done, then release bothnew_handleandold_handlebeforetrans.commit()through guarded callbacks.cuMemRelease()failures for allocate/fast/slow paths and assert rollback cleanup callbacks still execute.Validation
I attempted to run the targeted pytest selection in this environment, but
pytestis not installed in the available interpreter.Notes
This preserves rollback behavior while addressing the failure-after-commit edge described in PR review (release failures now remain within rollback coverage).